home *** CD-ROM | disk | FTP | other *** search
Text File | 1990-06-29 | 1.6 KB | 60 lines | [TEXT/GEOL] |
- Item 6311447 25-June-90 11:39PDT
-
- From: D4684 Robins Analytics, S Robins,PRT
-
- To: MACDTS Macintosh Developer Tech Supt
-
- cc: D4695 Skywalker Sys, Scott Collins,PRT
- MACAPP.TECH$ MacApp Technical
-
- Sub: Re: RE-Feedback in MacApp
-
- MG - the EMail Slave and Scott,
- I didn't word my question right. I not only want a dialog that gives
- feedback but I also need it to be able to be cancelled by a command-period.
- That is why I figured it needed to intercept events. In any case I have decided
- instead to create a routine FailCommandPeriod(error:OSErr); that would fail if
- command period was hit. See the below code.
-
- PROCEDURE FailCommandPeriod(error:OSErr);
-
- CONST
- myDlgMask = mDownMask + mUpMask + keyDownMask + keyUpMask + autoKeyMask;
-
-
- VAR
- ch: CHAR;
- keycode: INTEGER;
- anEvent: EventRecord;
-
- BEGIN
- IF gApplication.GetEvent(myDlgMask, 0, NIL, anEvent) THEN
- BEGIN
- CASE anEvent.what OF
- keyDown:
- WITH anEvent DO
- BEGIN
- ch := CHR(BAND(message, charCodeMask));
- keycode := BSR(BAND(message, keyCodeMask), 8);
- IF ((ch = '.') & (BAND(modifiers, cmdKey) <> 0)) | ((ch = chEscape) &
- (keycode = kEscapeVirtualCode)) THEN
- BEGIN
- FAILURE(error, 0);
- END;
- END;
- END;
- END;
- END;
-
- This code is stolen partially from the TStdPrintHandler's print idler
- procedure. It works but obviously it requires that you know how to fail
- gracefully from wherever it is called. Easier said than done.
-
- Thanks for the responses,
-
- Doug Ahmann
- Robins Analytics
- St. Paul
- ALink D4684
-
-